The prefix string is defined in the /var/sysgen/master.d file only. The string does not have to appear as a constant in the driver, and the name of the driver object file does not have to correspond to the prefix (although it typically has a related name).
The lboot command recognizes driver entry points by searching the driver object module for public names that begin with the prefix string. For example, the entry point for the open() operation must have a name that consists of the prefix string followed by the letters "open."
In this book, entry point names are written as follows: pfxopen, where pfx stands for the driver's prefix string.
bdevsw | Table of block device drivers |
cdevsw | Table of character device drivers |
fmodsw | Table of STREAMS drivers |
vfssw | Table of filesystem modules (not related to device drivers) |
The tables for block and character drivers have one row for each major device number, and one column for each possible driver entry point. As lboot loads a driver, it fills in that driver's row of a switch table with the addresses of the driver's entry points. Where an entry point is not defined, lboot leaves the address of a null routine that returns the ENODEV error code.
The sizes of the switch tables are fixed at boot time in order to minimize kernel data space. The table sizes are tunable parameters that can be set with systune (see the systune(1) reference page).
When a driver is loaded dynamically (see "Configuring a Loadable Driver"), the associated row of the switch table is not filled at link time but rather is filled when the driver is loaded. When you add new, loadable drivers, you might need to specify a larger switch table. The IRIX Administration: System Configuration and Operation book documents these tunable parameters.